<?php
html::printPath('viRegistration.form-title');
$msg->printMessages();
?>

<ul class="commandList">
    <li class="exportToExcel"><?php echo html::anchor('admin/viRegistration/exportToExcel', text::get('viRegistration.exportToExcel')) ?></li>
    <li class="searchCommand"><?php echo html::searchEntityAnchor($this); ?></li>
</ul>

<?php
echo '<div class="quickSearchField">';
$fb = new FormBuilder('viRegistration', $entity);
$fb->setAction('/admin/viRegistration/quickSearch');
$fb->autocompleter('quickSearch_id', $viRegistrationOptions)->mustMatch()->labelKey('application.quickSearch');
$fb->write();
echo '</div>';

function cancelledRowClass($viRegistration) {
    if ($viRegistration['cancelled_at']) {
        return 'cancelledRegRow';
    }
    return '';
}

$elb = new EntityListBuilder($this, $viRegistrationList);
$elb->rowCssClassFunction('cancelledRowClass');
$elb->integer('id');
$elb->text('name')->labelKey('viSeminar.name')->linkWithValue('/admin/viSeminar/display?id=', 'vi_seminar_id');
$elb->text('person_id')->doubleValue('last_name', 'first_name')->alignLeft()->orderByField('last_name')->linkWithValue('/admin/person/display?id=', 'person_id');
$elb->text('vi_accomodation_type_name')->labelKey('vi_accomodation_type_code');
$elb->timestamp('created_at');
$elb->text('total_price')->alignRight();
$elb->text('currency_code')->l10n('currency.mark-')->alignLeft();
$elb->boolean('social_discount_applied');
$elb->text('payment_type')->l10n('viregWizard.paymentType-');
$elb->write();
